<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7"/>
    <title>产品列表页</title>
    <link rel="icon" href="assets/img/favicon.ico">

    <link rel="stylesheet" type="text/css" href="css/webbase.css"/>
    <link rel="stylesheet" type="text/css" href="css/pages-list.css"/>
    <link rel="stylesheet" type="text/css" href="css/widget-cartPanelView.css"/>
    <script type="text/javascript" src="plugins/angularjs/angular.min.js"></script>
    <script type="text/javascript" src="js/base.js"></script>
    <script type="text/javascript" src="js/service/searchService.js"></script>
    <script type="text/javascript" src="js/controller/searchController.js"></script>
</head>

<body ng-app="lehuan" ng-controller="searchController" ng-init="loadkeywords()">
<!-- 头部栏位 -->
<!--页面顶部-->
<div id="nav-bottom">
    <!--顶部-->
    <div class="nav-top">
        <div class="top">
            <div class="py-container">
                <div class="shortcut">
                    <ul class="fl">
                        <li class="f-item">乐换欢迎您！</li>
                        <li class="f-item">请
                            <a href="login.html" target="_blank">登录</a>　<span><a href="register.html" target="_blank">免费注册</a></span>
                        </li>
                    </ul>
                    <ul class="fr">
                        <li class="f-item"><a href="http://localhost:9106/home-index.html" target="_blank">我的订单</a></li>
                        <li class="f-item space"></li>
                        <li class="f-item"><a href="http://localhost:9106/home-index.html" target="_blank">我的乐换</a></li>
                        <li class="f-item space"></li>
                        <li class="f-item"><a href="#">关注乐换</a></li>
                        <li class="f-item space"></li>
                        <li class="f-item" id="service">
                            <span><a href="#">客户服务</a></span>
                        </li>
                        <li class="f-item space"></li>
                        <li class="f-item"><a href="#">网站导航</a></li>
                    </ul>
                </div>
            </div>
        </div>
        <!--头部-->
        <div class="header">
            <div class="py-container">
                <div class="yui3-g Logo">
                    <div class="yui3-u Left logoArea">
                        <a class="logo-bd" title="乐换" href="JD-index.html" target="_blank"></a>
                    </div>
                    <div class="yui3-u Center searchArea">
                        <div class="search">
                            <form action="" class="sui-form form-inline">
                                <!--searchAutoComplete-->
                                <div class="input-append">
                                    <input type="text" id="autocomplete" ng-model="searchMap.keywords" type="text"
                                           class="input-error input-xxlarge"/>
                                    <!--修改搜索按钮，调用搜索前将起始页码设置为1，即每次搜索都是从第一页增加条件搜索-->
                                    <button class="sui-btn btn-xlarge btn-danger" ng-click="searchMap.pageNo=1;search()"
                                            type="button">搜索
                                    </button>
                                </div>
                            </form>
                        </div>
                    </div>
                    <div class="yui3-u Right shopArea">
                        <div class="fr shopcar">
                            <div class="show-shopcar" id="shopcar">
                                <span class="car"></span>
                                <a class="sui-btn btn-default btn-xlarge" href="cart.html" target="_blank">
                                    <span>我的购物车</span>
                                    <i class="shopnum">0</i>
                                </a>
                                <div class="clearfix shopcarlist" id="shopcarlist" style="display:none">
                                    <p>"啊哦，你的购物车还没有商品哦！"</p>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>

                <div class="yui3-g NavList">
                    <div class="yui3-u Left all-sort">
                        <h4>全部商品分类</h4>
                    </div>
                    <div class="yui3-u Center navArea">
                        <ul class="nav">
                            <li class="f-item">服装</li>
                            <li class="f-item">图书</li>
                            <li class="f-item">乐换超市</li>
                            <li class="f-item">全球购</li>
                            <li class="f-item">生活用品</li>
                            <li class="f-item">电子产品</li>
                            <li class="f-item">学习用品</li>
                        </ul>
                    </div>
                    <div class="yui3-u Right"></div>
                </div>
            </div>
        </div>
    </div>
</div>

<!--list-content-->
<div class="main">
    <div class="py-container">
        <!--面包屑-->
        <div class="bread">
            <ul class="fl sui-breadcrumb">
                <li>
                    <a href="#">搜索结果：</a>
                </li>
            </ul>
            <ul class="tags-choose">
                <!--增加各种搜索条件面包屑-->
                <!--ng-if做判断，因为在js中已经初始化分类和品牌为空字符串了，所以这里就判断他们不为空的时候执行-->
                <li class="tag" ng-if="searchMap.category!=''" ng-click="removeSearchItem('category')">
                    商品分类：{{searchMap.category}}<i class="sui-icon icon-tb-close"></i></li>
                <li class="tag" ng-if="searchMap.brand!=''" ng-click="removeSearchItem('brand')">
                    品牌：{{searchMap.brand}}<i class="sui-icon icon-tb-close"></i></li>
                <!--因为searchMap.spec是一个Map，所以循环得到的是一个对象，用(key,value)这种形式接收-->
                <li class="tag" ng-repeat="(key,value) in searchMap.spec" ng-click="removeSearchItem(key)">
                    {{key}}:{{value}}<i class="sui-icon icon-tb-close"></i></li>
                <li class="tag" ng-if="searchMap.price!=''" ng-click="removeSearchItem('price')">
                    价格：{{searchMap.price}}<i class="sui-icon icon-tb-close"></i></li>
                搜索结果:{{resultMap.total}}条记录
            </ul>
            <div class="clearfix"></div>
        </div>
        <!--selector-->
        <div class="clearfix selector">
            <!--分类列表如果为空或者分类不为空则隐藏分类列表，否则则显示-->
            <div class="type-wrap" ng-if="resultMap.categoryList!=null&& searchMap.category==''">
                <div class="fl key">商品分类</div>
                <div class="fl value">
                    <!--resultMap是关键字搜索返回的结果Map,categoryList是这个map的一个key-->
                    <span ng-repeat="category in resultMap.categoryList">
                        <!--addSearchItem是添加搜索项,第一个category是key，第二个是循环分类列表中的value-->
                        <a href="#" ng-click="addSearchItem('category',category)">{{category}}</a>
                    </span>
                </div>
                <div class="fl ext"></div>
            </div>
            <!--品牌列表-->
            <!--品牌列表如果为空或者品牌不为空或者关键词是是品牌的时候则隐藏分类列表，否则则显示，
            searchMap.brand==''，等于空说明还没有选择就要显示这个面板
            keywordsIsBrand如果是关键字就不显示，等于false表示不是关键字才显示-->
            <div class="type-wrap logo"
                 ng-if="resultMap.brandList!=null && searchMap.brand==''&& keywordsIsBrand()==false">
                <div class="fl key brand">品牌</div>
                <div class="value logos">
                    <ul class="logo-list">
                        <li ng-repeat="brand in resultMap.brandList">
                            <!--addSearchItem添加搜索项，这里是点击品牌的时候-->
                            <a href="#" ng-click="addSearchItem('brand',brand.text)">{{brand.text}}</a>
                        </li>
                    </ul>
                </div>
                <div class="ext">
                    <a href="javascript:void(0);" class="sui-btn">多选</a>
                    <a href="javascript:void(0);">更多</a>
                </div>
            </div>
            <!--规格参数，ng-if="searchMap.spec[spec.text]==null"，为空则隐藏-->
            <div class="type-wrap" ng-repeat="spec in resultMap.specList" ng-if="searchMap.spec[spec.text]==null">
                <div class="fl key">{{spec.text}}</div>
                <div class="fl value">
                    <ul class="type-list">
                        <!--options是业务类中的map的key-->
                        <li ng-repeat="option in spec.options">
                            <a href="#" ng-click="addSearchItem(spec.text,option.optionName)">{{option.optionName}}</a>
                        </li>
                    </ul>
                </div>
                <div class="fl ext"></div>
            </div>

            <div class="type-wrap" ng-if="searchMap.price==''">
                <div class="fl key">价格</div>
                <div class="fl value">
                    <ul class="type-list" ng-if="searchMap.price==''">
                        <!--增加价格搜索选项-->
                        <li>
                            <a href="#" ng-click="addSearchItem('price','0-500')">0-500元</a>
                        </li>
                        <li>
                            <a href="#" ng-click="addSearchItem('price','500-1000')">500-1000元</a>
                        </li>
                        <li>
                            <a href="#" ng-click="addSearchItem('price','1000-1500')">1000-1500元</a>
                        </li>
                        <li>
                            <a href="#" ng-click="addSearchItem('price','1500-2000')">1500-2000元</a>
                        </li>
                        <li>
                            <a href="#" ng-click="addSearchItem('price','2000-3000')">2000-3000元 </a>
                        </li>
                        <li>
                            <a href="#" ng-click="addSearchItem('price','3000-*')">3000元以上</a>
                        </li>
                    </ul>
                </div>
                <div class="fl ext">
                </div>
            </div>
        </div>
        <!--details-->
        <div class="details">
            <div class="sui-navbar">
                <div class="navbar-inner filter">
                    <ul class="sui-nav">
                        <li class="active">
                            <!--综合即默认，按原来的排序-->
                            <a href="#" ng-click="sortSearch('','')">综合</a>
                        </li>
                        <li>
                            <a href="#">销量</a>
                        </li>
                        <li>
                            <a href="#" ng-click="sortSearch('updatetime','DESC')">新品</a>
                        </li>
                        <li>
                            <a href="#">评价</a>
                        </li>
                        <li>
                            <a href="#" ng-click="sortSearch('price','ASC')">价格↑</a>
                        </li>
                        <li>
                            <a href="#" ng-click="sortSearch('price','DESC')">价格↓</a>
                        </li>
                    </ul>
                </div>
            </div>
            <div class="goods-list">
                <ul class="yui3-g">
                    <li class="yui3-u-1-5" ng-repeat="item in resultMap.rows">
                        <div class="list-wrap">
                            <div class="p-img">
                                <a href="http://localhost:9105/{{item.id}}.html" target="_blank"><img
                                        src="{{item.image}}"/></a>
                            </div>
                            <div class="price">
                                <strong>
                                    <em>¥</em>
                                    <i>{{item.price}}</i>
                                </strong>
                            </div>
                            <!--<div class="attr">
                                <em>{{item.title}}</em>
                            </div>-->
                            <!--调用过滤器trustHtml，这是过滤器名称，竖线 |用于调用过滤器-->
                            <div class="attr" ng-bind-html="item.title | trustHtml"></div>
                            <div class="cu">
                                <em></em>
                            </div>
                            <div class="commit">
                                <i class="command">已有2000人评价</i>
                            </div>
                            <div class="operate">
                                <a href="success-cart.html" target="_blank" class="sui-btn btn-bordered btn-danger">加入购物车</a>
                                <a href="javascript:void(0);" class="sui-btn btn-bordered">对比</a>
                                <a href="javascript:void(0);" class="sui-btn btn-bordered">关注</a>
                            </div>
                        </div>
                    </li>

                </ul>
            </div>
            <div class="fr page">
                <div class="sui-pagination pagination-large">
                    <ul>
                        <!--'disabled'表示是白色,即可以点击的，isTopPage判断是否为第一页，如果是的话点击的样式不可用-->
                        <li class="prev {{isTopPage()?'disabled':''}}">
                            <a href="#" ng-click="queryByPage(searchMap.pageNo-1)">«</a>
                        </li>
                        <!--页码前的省略号-->
                        <li class="dotted" ng-if="firstDot==true"><span>...</span></li>
                        <li ng-repeat="page in pageLabel">
                            <a href="#" ng-click="queryByPage(page)">{{page}}</a>
                        </li>
                        <!--页码后的省略号-->
                        <li class="dotted" ng-if="lastDot==true"><span>...</span></li>
                        <li class="next {{isEndPage()?'disabled':''}}">
                            <a href="#" ng-click="queryByPage(searchMap.pageNo+1)">»</a>
                        </li>
                    </ul>
                    <div><span>共{{resultMap.totalPages}}页&nbsp;</span>
                        <!--绑定当前页searchMap.pageNo，传到后端会变成字符串，后端的方法参数是整型，所以要在js中转换为整型-->
                        <span>到第<input type="text" class="page-num" ng-model="searchMap.pageNo">页
                        <button class="page-confirm" ng-click="queryByPage(searchMap.pageNo)">确定</button></span>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<!-- 底部栏位 -->
<!--页面底部-->
<div class="clearfix footer">
    <div class="py-container">
        <div class="footlink">
            <div class="Mod-service">
                <ul class="Mod-Service-list">
                    <li class="grid-service-item intro  intro1">

                        <i class="serivce-item fl"></i>
                        <div class="service-text">
                            <h4>正品保障</h4>
                            <p>正品保障，提供发票</p>
                        </div>

                    </li>
                    <li class="grid-service-item  intro intro2">

                        <i class="serivce-item fl"></i>
                        <div class="service-text">
                            <h4>正品保障</h4>
                            <p>正品保障，提供发票</p>
                        </div>

                    </li>
                    <li class="grid-service-item intro  intro3">

                        <i class="serivce-item fl"></i>
                        <div class="service-text">
                            <h4>正品保障</h4>
                            <p>正品保障，提供发票</p>
                        </div>

                    </li>
                    <li class="grid-service-item  intro intro4">

                        <i class="serivce-item fl"></i>
                        <div class="service-text">
                            <h4>正品保障</h4>
                            <p>正品保障，提供发票</p>
                        </div>

                    </li>
                    <li class="grid-service-item intro intro5">

                        <i class="serivce-item fl"></i>
                        <div class="service-text">
                            <h4>正品保障</h4>
                            <p>正品保障，提供发票</p>
                        </div>

                    </li>
                </ul>
            </div>
            <div class="clearfix Mod-list">
                <div class="yui3-g">
                    <div class="yui3-u-1-6">
                        <h4>购物指南</h4>
                        <ul class="unstyled">
                            <li>购物流程</li>
                            <li>会员介绍</li>
                            <li>生活旅行/团购</li>
                            <li>常见问题</li>
                            <li>购物指南</li>
                        </ul>

                    </div>
                    <div class="yui3-u-1-6">
                        <h4>配送方式</h4>
                        <ul class="unstyled">
                            <li>上门自提</li>
                            <li>211限时达</li>
                            <li>配送服务查询</li>
                            <li>配送费收取标准</li>
                            <li>海外配送</li>
                        </ul>
                    </div>
                    <div class="yui3-u-1-6">
                        <h4>支付方式</h4>
                        <ul class="unstyled">
                            <li>货到付款</li>
                            <li>在线支付</li>
                            <li>分期付款</li>
                            <li>邮局汇款</li>
                            <li>公司转账</li>
                        </ul>
                    </div>
                    <div class="yui3-u-1-6">
                        <h4>售后服务</h4>
                        <ul class="unstyled">
                            <li>售后政策</li>
                            <li>价格保护</li>
                            <li>退款说明</li>
                            <li>返修/退换货</li>
                            <li>取消订单</li>
                        </ul>
                    </div>
                    <div class="yui3-u-1-6">
                        <h4>特色服务</h4>
                        <ul class="unstyled">
                            <li>夺宝岛</li>
                            <li>DIY装机</li>
                            <li>延保服务</li>
                            <li>乐换E卡</li>
                            <li>乐换通信</li>
                        </ul>
                    </div>
                    <div class="yui3-u-1-6">
                        <h4>帮助中心</h4>

                    </div>
                </div>
            </div>
            <div class="Mod-copyright">
                <ul class="helpLink">
                    <li>关于我们<span class="space"></span></li>
                    <li>联系我们<span class="space"></span></li>
                    <li>关于我们<span class="space"></span></li>
                    <li>商家入驻<span class="space"></span></li>
                    <li>营销中心<span class="space"></span></li>
                    <li>友情链接<span class="space"></span></li>
                    <li>关于我们<span class="space"></span></li>
                    <li>营销中心<span class="space"></span></li>
                    <li>友情链接<span class="space"></span></li>
                    <li>关于我们</li>
                </ul>
                <p>地址：广东省广州市天河区中山大道西293号 邮编：510000   电话：020-12345678</p>
                <p>粤ICP备19020121号粤公网安备100210296242</p>
            </div>
        </div>
    </div>
</div>
<!--页面底部END-->
<script type="text/javascript" src="js/plugins/jquery/jquery.min.js"></script>
<script type="text/javascript">
    $(function () {
        $("#service").hover(function () {
            $(".service").show();
        }, function () {
            $(".service").hide();
        });
        $("#shopcar").hover(function () {
            $("#shopcarlist").show();
        }, function () {
            $("#shopcarlist").hide();
        });

    })
</script>
<script type="text/javascript" src="js/model/cartModel.js"></script>
<script type="text/javascript" src="js/czFunction.js"></script>
<script type="text/javascript" src="js/plugins/jquery.easing/jquery.easing.min.js"></script>
<script type="text/javascript" src="js/plugins/sui/sui.min.js"></script>
<script type="text/javascript" src="js/widget/cartPanelView.js"></script>
</body>

</html>